// 回到顶部
let returnTop = document.querySelector('.returnTop')
//滑到距离顶部800px的地方显示，点击之后回到顶部
window.addEventListener('scroll', function () {
    //获取滚动距离
    let sTop = document.documentElement.scrollTop


    //判断
    if (sTop >= 800) {
        returnTop.style.display = 'block' //显示
    } else {
        returnTop.style.display = 'none'  //隐藏
    }
    returnTop.addEventListener('click', function () {
    window.scrollTo({
        top: 0,
        behavior: "smooth"
    })
})
})


